home *** CD-ROM | disk | FTP | other *** search
- /*
- * This software is copyright 1992 by Robert Morris.
- * You may freely redistribute this software as shareware
- * if you do so in the same form as you got it. If you find
- * this software useful, please send $12 to:
- * Robert Morris
- * P.O. Box 1044
- * Harvard Square Station
- * Cambridge, MA 02238
- * ecognome@aol.com
- * If you incorporate any of this software in any kind of
- * commercial product, please send $2 per copy distributed
- * to the above address.
- */
-
- #ifndef tiff_h
- #define tiff_h 1
-
- /*
- * this is from the TIFF 5.0 document of 8/8/88
- */
-
- /* first eight bytes of a TIFF file: */
- struct TIFFHeader{
- short byteOrder; /* 0x4949: little-endian; 0x4d4d: big-endian */
- short versionNumber; /* always 42 */
- unsigned long offset; /* to first Image File Directory */
- };
-
- #define LittleEndian 0x4949
- #define BigEndian 0x4d4d
-
- /*
- * an Image File Directory has 2 bytes with the number of entries,
- * then the entries, then 4 bytes of offset to the next IFD, or 0.
- */
- struct TIFFEntry{
- short tag;
- short type; /* TIFF_BYTE, TIFF_ASCII, TIFF_SHORT, TIFF_LONG, TIFF_RATIONAL */
- long length; /* really a count */
- long offset; /* offset in file, or value if <= 4 bytes */
- };
-
- #define TIFF_BYTE 1 /* 8-bit unsigned integer */
- #define TIFF_ASCII 2 /* ascii string; last byte is null */
- #define TIFF_SHORT 3 /* 16 bit unsigned integer */
- #define TIFF_LONG 4 /* 32-bit unsigned integer */
- #define TIFF_RATIONAL 5 /* two longs: numerator, denominator */
-
- /* the entry types */
- #define ColorMap 320
- #define NewSubfileType 254
- #define ImageWidth 256
- #define ImageLength 257
- #define BitsPerSample 258
- #define Compression 259
- #define NoCompression 1
- #define LZWCompression 5
- #define PackCompression 32773
- #define PhotometricInterpretation 262
- #define PIZeroIsWhite 0
- #define PIZeroIsBlack 1
- #define PIRGB 2
- #define PIPalette 3
- #define StripOffsets 273
- #define SamplesPerPixel 277
- #define RowsPerStrip 278
- #define StripByteCounts 279
- #define XResolution 282
- #define YResolution 283
- #define PlanarConfiguration 284
- #define PCContiguous 1 /* RGBRGB... */
- #define PCPlanar 2 /* RR...GG...BB... */
- #define ResolutionUnit 296
- #define Predictor 317
- #define NoPredictor 1
- #define HDPredictor 2
-
- #endif tiff_h